package com.sino.app.service.biz.bo.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.sinosoft.framework.service.base.biz.bo.AbstractBaseBo;
import com.sinosoft.dependency.util.StringUtil;
import com.sinosoft.framework.service.base.ServiceBaseConstant;
import com.sinosoft.dependency.exception.MessageException;
import java.util.Objects;
import com.sino.app.service.biz.dao.ModelInfoMapper;
import com.sino.app.service.biz.bo.IModelInfoBo;
import com.sino.app.service.domain.ModelInfo;

/**
 * 模型主表（公共字段）业务逻辑实现组件
 */
@Repository
public class ModelInfoBo extends AbstractBaseBo implements IModelInfoBo{
	/**
	*模型主表（公共字段）数据库访问组件
	*/
    @Autowired
    private ModelInfoMapper modelInfoMapper;    
    @Override
	public void insert(ModelInfo modelInfo){
    modelInfoMapper.insert(modelInfo);
	}
	
	@Override
	public void update(ModelInfo modelInfo){
		Integer count = modelInfoMapper.update(modelInfo);
		if(!Objects.equals(count, 1)){
		    throw new MessageException(ServiceBaseConstant.UPDATE_FAIL_MESSAGE);
		}
	}
	
	@Override
	public List<ModelInfo> list(ModelInfo modelInfo){
		return modelInfoMapper.list(modelInfo);
	}
	
	@Override
	public ModelInfo get(Long id){
		return modelInfoMapper.get(id);
	}
}